const baseURL="https://api-hmugo-web.itheima.net/api/public/v1"
async  function request({url,method="get",header={Authorization:uni.getStorageSync("token")},data={} }){
		uni.showLoading({title:"加载中"})
	 const	res=await uni.request({url:baseURL+url,header,data,method})
		uni.hideLoading()
		console.log(res)
		// if(res.status)
		if (res.data.meta.status === 200) {
			    return {
			      msg: res.data.meta.msg,
			      data: res.data.message
			    }
			  } else {
			    return Promise.reject(res.data.meta.msg)
			  }
	}
// export default request
export default{
	install(Vue){
		Vue.prototype.request=request
	}
}